package thread;

public class InterruptedDemo {
    public static void main(String[] args) {
        Thread t1 = new Thread("lin"){
            @Override
            public void run() {
                System.out.println(getName()+":睡一觉");
                try {
                    Thread.sleep(100000);
                } catch (InterruptedException e) {
                    System.out.println("干嘛呢");
                }
                System.out.println("醒了");
            }
        };



        Thread t2 = new Thread("huang"){
            @Override
            public void run() {
                System.out.println(getName()+":大锤80，小锤40");
                for (int i = 0; i < 5; i++) {
                    System.out.println(getName()+":80!");
                }
                System.out.println(getName()+":收工");
                t1.interrupt();
            }
        };
        t1.start();
        t2.start();
    }
}
